<?
include("../com.inc.php");
if(!$_SESSION['memberID']){exit("<script>window.location='dlogin.html'</script>");}
if($_SESSION['memberID']==2 || $_SESSION['memberID']==89){exit("<script>alert('该账号不可修改!');</script>");}
$ops=$_REQUEST["ops"];
$nps=$_REQUEST["nps"];
$dps=$_REQUEST["dps"];
$sel="select password from pft_member where id=".$_SESSION["memberID"];
$GLOBALS['le']->query($sel);
$GLOBALS['le']->fetch_assoc();
$password=$GLOBALS['le']->f("password");
if($password!=md5($ops)){
	echo "<script>alert('当前密码错误!');</script>";
	exit;
}

if($dps!=$nps){
	echo "<script>alert('2次输入的密码不同!');</script>";
	exit;
}
else{
	$password=md5($nps);
}
$upd="update pft_member set password='".$password."' where id=".$_SESSION["memberID"];
if($GLOBALS['le']->query($upd)){
	echo "<script>alert('修改成功!');window.parent.location='shops/gmem_pass.html';</script>";
}
?>